home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 21.zip / BS1 part 21 / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].7z / Professional Page v4.0 (1993)(Gold Disk)(Disk 1 of 4)[HD].adf / rexx.lzh / CopyBoxAttributes.pprx < prev    next >
Text File  |  1992-03-13  |  2KB  |  133 lines

  1. /*
  2. @BCopyBoxAttributes  @P@ICopyright Gold Disk Inc., February, 1992
  3.  
  4. This Genie will copy attributes from one box to any number of other boxes.
  5. */
  6. parse arg source
  7.  
  8. cr  = '0a'x
  9. address command
  10. call SafeEndEdit.rexx()
  11.  
  12. if source = '' then
  13. do
  14.  
  15.     source  = ppm_ClickOnBox("Click on box which has attributes to be copied..")
  16.     if source = 0 then exit_msg()
  17.  
  18.    call ppm_SelectBox(source)
  19.  
  20.     counter = 1
  21.  
  22.     do forever
  23.  
  24.        box = ppm_ClickOnBox("Click on boxes to which attributes will be applied..")
  25.        if box = 0 then leave
  26.  
  27.       call ppm_SelectBox(box)
  28.  
  29.        boxes.counter = box
  30.        counter = counter + 1
  31.  
  32.     end
  33.  
  34.     if counter = 1 then
  35.     exit_msg()
  36.     else
  37.     counter = counter - 1
  38.  
  39. end
  40. else
  41. do
  42.  
  43.     if list = '' then exit_msg("Invalid Input")
  44.  
  45.     do counter = 1 to words(list)
  46.  
  47.     boxes.counter = word(list, counter)
  48.  
  49.     end
  50.  
  51. end
  52.  
  53. call ppm_AutoUpdate(0)
  54. attributes = "Frame"cr"FrameData"cr"Offset"cr"Angle"cr"TextWrap"cr"Hide"cr"Lock"cr"Standoff"cr"Margins"cr"Transparent"cr"Scale"cr"Tabs"cr"Position"cr"Size"
  55.  
  56. attributes = ppm_SelectFromList("Select attributes to copy..", 30, 5, 1, attributes)
  57. if attributes = '' then exit_msg()
  58.  
  59. copy = attributes
  60.  
  61. boxnum = 0
  62.  
  63. do while copy ~= ''
  64.  
  65.     parse var copy itemname '0a'x copy
  66.  
  67.     interpret itemname" = ppm_GetBox"itemname"(source)"
  68.  
  69.     if itemname = "Tabs" then
  70.         istring = "call SetBoxTabs(boxes.i, '"Tabs"')"
  71.     else if itemname = "FrameData" then
  72.     do
  73.          parse var FrameData fcolor '0a'x lcolor '0a'x lwght '0a'x lpat '0a'x fpat '0a'x
  74.          istring = "call  ppm_SetBoxFrameData(boxes.i, fcolor, lcolor, lwght, lpat, fpat)"
  75.     end
  76.     else
  77.        istring = "call ppm_SetBox"itemname"(boxes.i, " || separate(value(itemname)) || ")"
  78.  
  79.     boxnum = boxnum + 1
  80.     strings.boxnum = istring
  81.  
  82. end
  83.  
  84. call ppm_ShowStatus("Working..")
  85.  
  86.  
  87. do i = 1 to counter
  88.  
  89.     copy    = attributes
  90.  
  91.     do s = 1 to boxnum
  92.  
  93.          interpret strings.s
  94.  
  95.     end
  96.  
  97. end
  98.  
  99. exit_msg()
  100.  
  101. separate: procedure
  102. do
  103.     arg string
  104.  
  105.     output = ''
  106.  
  107.     wrds    = words(string)
  108.  
  109.     if wrds = 1 then return(string)
  110.  
  111.     do i = 1 to wrds - 1
  112.  
  113.        output = output||word(string, i)", "
  114.  
  115.     end
  116.  
  117.     output = output || word(string, wrds)
  118.  
  119.     return(output)
  120.  
  121. end
  122.  
  123.  
  124. exit_msg: procedure
  125. do
  126.     parse arg message
  127.  
  128.     if message ~= '' then call ppm_Inform(1,message,)
  129.     call ppm_AutoUpdate(1)
  130.     call ppm_ClearStatus()
  131.     exit
  132. end
  133.